package dao;

import util.RandomString;
import util.Time;
import util.db.MySqlConn;

public class OrderPackage {

	public static int InsertOrderPackage(String tracking_unm, int shipping_method_id, int order_id)
	{
		String package_num = Time.GetTimeToFormatString() + RandomString.GetRandomString(8);
		String sql = "insert into order_packages(package_num, tracking_num, shipping_method_id, order_id," +
				"status, modified, modify_id, created) values ('" +
				package_num + "','" + tracking_unm + "'," + shipping_method_id + "," + order_id + "," + 
				1 + ", now(), 'Akimimi', now()" + " )";
		System.out.println("[" + Time.nowTime() + "]: " + sql);
		MySqlConn  mysqlConn = new MySqlConn();
		int package_id = mysqlConn.executeGetid(sql);
		mysqlConn.closeConn();
		return package_id;
	}
}
